class FileProcess
  attr_accessor :input, :output
  def initialize(input,output)
    begin
      $input = File.new(input, "r")
      $output = File.new(output, "w")
    rescue 
      puts "file not found"
      Process.exit
    end
  end
  def conver( )
    puts "Start conver"
    while (line = $input.gets)
      $output.puts "#{line.swapcase}"
    end
    puts "complete"
  end
end

print "Input file:"
input = gets.chomp.to_s
print "Output file:"
output = gets.chomp.to_s
fileProcess = FileProcess.new(input,output)
fileProcess.conver()